package com.chenxi.annotation.mapper;

import com.chenxi.bean.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserMapper {

    @Insert(value = "insert into user values(#{id}, #{username}, #{password}, #{birthday})")
    void insert(User user);

    @Update(value = "update user set username =#{username} where id = #{id}")
    void update(User user);

    @Delete(value = "delete from user where id = #{id}")
    void delete(Integer id);

    @Select(value = "select * from user")
    List<User> selectList();

}
